package com.ruoyi.web.controller.business.rule;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.business.rule.domain.JbRules;
import com.ruoyi.business.rule.service.JbRulesService;
import com.ruoyi.common.core.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 提成规则 Controller
 *
 * @author ruoyi
 * @date 2024-10-11
 */
@Api("提成规则")
@RestController
@RequestMapping("royalties")
public class JbRoyaltiesRulesController extends JbRulesController
{
    @Autowired
    private JbRulesService service;

    /**
     * 获取 提成规则 详细信息
     */
    @ApiOperation("获取 提成规则 详细信息")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        LambdaQueryWrapper<JbRules> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(JbRules::getId, id)
                .eq(JbRules::getRulesCode, "royalties");
        return success(service.getOne(queryWrapper));
    }

}
